using System;

namespace SvnPmtHook
{
    public class SvnLookExecutor : ISvnLookExecutor
	{
		private ICaptureConsole _concap;
		private string _pathToSvnLook;
		private string _repoPath;
		public SvnLookExecutor(ICaptureConsole concap, string pathToSvnLook, string repoPath)
		{
			_concap = concap;
			_pathToSvnLook = pathToSvnLook;
			_repoPath = repoPath;
		}

		public string Execute(string svnlookSubCommand, int revision)
		{
			string command = String.Format("{0} {1} {2} -r{3}", _pathToSvnLook, svnlookSubCommand, _repoPath, revision);
			return _concap.Capture(command);
		}
	}
}
